/*
This file is part of SmartShopper

SmartShopper is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SmartShopper is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with vlc-remote.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef SHOPLISTCONTROL_H
#define SHOPLISTCONTROL_H

#include <QObject>
//#include <QStringList>

class ShopListModel;

class ShopListControl : public QObject
{
    Q_OBJECT
    //    Q_PROPERTY (int listId READ id)
    Q_ENUMS(SortOrder)
    Q_PROPERTY (QString nameFilter READ nameFilter WRITE setNameFilter NOTIFY filterChanged)
    //    Q_PROPERTY (int storeFilter READ storeFilter WRITE setStoreFilter NOTIFY storeFilterChanged)
    //    Q_PROPERTY (int stateFilter READ stateFilter WRITE setStateFilter NOTIFY stateFilterChanged)
    Q_PROPERTY (int sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged)
    Q_PROPERTY (bool sortDown READ sortDown WRITE setSortDown NOTIFY sortDownChanged)

public:
//    explicit ShopListControl(QObject *parent = 0);
    explicit ShopListControl(ShopListModel * cModel, QObject *parent = 0);
    ~ShopListControl();

signals:
    void filterChanged();
    //    void storeFilterChanged();
    //    void stateFilterChanged();
    void sortOrderChanged();
    void sortDownChanged();

public slots:
    void deleteItem(int cIndex);
    QString nameFilter();
    void setNameFilter(const QString &cNameFilter);
    //    int storeFilter();
    //    void setStoreFilter(const int cStoreFilter);
    //    int stateFilter();
    //    void setStateFilter(const int cStateFilter);
    bool sortDown();
    void setSortDown(const bool &cSortDown);
    int sortOrder();
    void setSortOrder(const int &cSortOrder);

private:
    void getListDb();

private:
    QString mNameFilter;
    bool mSortDown;
    int mSortIndex;
    //    int mStoreFilter;
    //    int mStateFilter;
    ShopListModel * model;

};

#endif // SHOPLISTCONTROL_H
